from typing import Any, Dict, List, Optional, Union

import torch

class GlobalStateGuard:
    def check(self) -> bool: ...

class TensorGuards:
    def __init__(
        self,
        *,
        dynamic_dims_sizes: Optional[List[Optional[torch.SymInt]]] = None,
        dynamic_dims_strides: Optional[List[Optional[torch.SymInt]]] = None,
    ): ...
    def check(self, *args) -> bool: ...
    def check_verbose(self, *args, tensor_check_names=None) -> Union[bool, str]: ...

def assert_size_stride(
    item: torch.Tensor, size: torch.types._size, stride: torch.types._size
): ...
def check_obj_id(obj: object, expected: int) -> bool: ...
def check_type_id(obj: object, expected: int) -> bool: ...
def dict_version(d: Dict[Any, Any]) -> int: ...
